﻿using KouDai.Core.ViewModel;
using KouDai.Phone.Common;
using Windows.Foundation;
using Windows.System.Threading;
using System.Net;

namespace KouDai.Phone
{
    public partial class MainPage : PhoneAwarePage
    {
        // Constructor
        private MainViewModel _main;
        public MainPage()
        {
            InitializeComponent();

            // Set the data context of the listbox control to the sample data
            _main = this.DataContext as MainViewModel;

            // Sample code to localize the ApplicationBar
            //BuildLocalizedApplicationBar();
        }


        #region Override
        protected override async void InitData()
        {
            await _main.GetItems();
        }
        #endregion

      
        // Load data for the ViewModel Items

        // Sample code for building a localized ApplicationBar
        //private void BuildLocalizedApplicationBar()
        //{
        //    // Set the page's ApplicationBar to a new instance of ApplicationBar.
        //    ApplicationBar = new ApplicationBar();

        //    // Create a new button and set the text value to the localized string from AppResources.
        //    ApplicationBarIconButton appBarButton = new ApplicationBarIconButton(new Uri("/Assets/AppBar/appbar.add.rest.png", UriKind.Relative));
        //    appBarButton.Text = AppResources.AppBarButtonText;
        //    ApplicationBar.Buttons.Add(appBarButton);

        //    // Create a new menu item with the localized string from AppResources.
        //    ApplicationBarMenuItem appBarMenuItem = new ApplicationBarMenuItem(AppResources.AppBarMenuItemText);
        //    ApplicationBar.MenuItems.Add(appBarMenuItem);
        //}
    }
}